package com.freeLearning.boot.course.model.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.freeLearning.boot.common.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.checkerframework.checker.formatter.qual.Format;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@EqualsAndHashCode(callSuper = true)
@Data
@TableName("user_course")
public class UserCourse extends BaseEntity {
    @Schema(description = "用户ID")
    private Long userId;

    @Schema(description = "用户名")
    private String userName;

    @Schema(description = "课程ID")
    private Long courseId;

    @Schema(description = "课程名")
    private String courseName;

    @Schema(description = "咨询师ID")
    private Long consultantId;

    @Schema(description = "咨询师名")
    private String consultantName;

    @Schema(description = "学习进度（百分比）")
    private BigDecimal progress;

    @Schema(description = "学习时长（秒）")
    private Long learningDuration;

    @Schema(description = "学习状态（0: 未开始, 1: 学习中, 2: 已完成）")
    private Integer status;

    @Schema(description = "上次学习时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastLearnTime;

    @Schema(description = "当前学习到的分集编号")
    private Integer currentChapter;
    @Schema(description = "课程分类 id")
    private Long categoryId;
    @Schema(description = "课程分类名称")
    private String categoryName;

    @Schema(description = "课程封面")
    private String coverImage;
}
